<template>
  <el-dialog :visible.sync="centerDialogVisible" :before-close="closeLogin" width="30%" center :closeOnClickModal="false">
    <span>尊敬的管理员，您确定退出吗？</span>
    <span slot="footer" class="dialog-footer">
      <el-button @click="closeLogin">取 消</el-button>
      <el-button type="primary" @click="loginOut">确 定</el-button>
    </span>
  </el-dialog>
</template>

<script>
export default {
  props: ["loginShow"],
  data() {
    return {
      centerDialogVisible: false
    };
  },
  watch: {
    loginShow: {
      handler(newVal, oldVal) {
        if (newVal === 1) {
          this.centerDialogVisible = true;
        }
      }
    }
  },
  methods: {
    handleClick(tab, event) {
      console.log(tab, event);
    },
    closeLogin() {
      this.centerDialogVisible = false;
      this.$emit("closeLogin", 0);
    },
    //退出
    loginOut(){
      this.$router.push({ path: "./login" });
    }
  }
};
</script>

<style>
</style>